import request from '@/router/axios';

// 获取列表
export const getPersPonList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/basic/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 获取部门列表
export const getAllDept = () => {
  return request({
    url: '/api/blade-system/dept/getAllDepts',
    method: 'get',
  })
}

// 同步
export const asynchronousFn = (deptIds) => {
  return request({
    url: '/api/blade-purchase/basic/getPurchasePerson',
    method: 'get',
    params: {
      deptIds
    }
  })
}

// 查看&编辑
export const detail = (id) => {
  return request({
    url: '/api/blade-purchase/basic/materialGroupDetail',
    method: 'get',
    params: {
      id
    }
  })
}

// 保存
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/basic/saveMaterialGroup',
    method: 'post',
    data: data
  })
}
